// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_fk.p_b;

 

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.concurrent.*;

// Referenced classes of package com.nnee.p_fk.b:
//            e, a, f

public class cls_c
{

    public cls_c()
    {
        this(5, 3);
    }

    public cls_c(int k, int l)
    {
        d = new PriorityBlockingQueue();
        c = new Hashtable();
        i = k;
        e = new ThreadPoolExecutor(l, 30, 2000L, TimeUnit.MICROSECONDS, d);
    }

    /**
     * @deprecated Method a is deprecated
     */

    public static int a()
    {
        
        int k;
        if(j >= 32767)
            j = 0;
        k = 1 + j;
        j = k;
       
        return k;
       
    }

    /**
     * @deprecated Method a is deprecated
     */

    public static int a(int k)
    {
    	int l = j;
        
        if(k > 0) {
        	if(k + j >= 32767)
                j = 0;
            l = 1 + j;
            j = k + j;
            
        } 
        return l;    }

    public cls_e a(Integer integer)
    {
        Hashtable hashtable = c;
        
        cls_e e1 = (cls_e)c.get(integer);
        return e1;
    }

    public void a(int k, int l)
    {
        Integer integer = new Integer(k);
        cls_e e1;
        synchronized(c)
        {
            e1 = (cls_e)c.get(integer);
        }
        if(e1 != null)
            e1.b(l);
        return;
        
    }

    public void a(cls_e e1)
    {
        if(e1 == null)
            return;
        e1.a(this);
        Integer integer = new Integer(e1.m());
        if(e1 instanceof cls_a)
            ((cls_a)e1).a(h);
        synchronized(c)
        {
            c.put(integer, e1);
        }
        e.execute(e1);
         return;
       
    }

    public void a(cls_f f1)
    {
        h = f1;
    }

    public void b()
    {
        if(a != null)
        {
            b = true;
            a = null;
            d.clear();
            if(g && f != null)
            {
                f.e();
                f = null;
            }
        }
    }

    public void b(int k)
    {
        if(k > 0) {
        Hashtable hashtable = c;
        
        Enumeration enumeration = c.elements();
        do
        {
            if(!enumeration.hasMoreElements())
                break;
            cls_e e1 = (cls_e)enumeration.nextElement();
            if(e1 != null && e1.l() == k)
            {
                e1.e();
                c.remove(new Integer(e1.m()));
            }
        } while(true);
        }
    }

    public void b(int k, int l)
    {
        Hashtable hashtable = c;
        
        Enumeration enumeration = c.elements();
        do
        {
            if(!enumeration.hasMoreElements())
                break;
            cls_e e1 = (cls_e)enumeration.nextElement();
            if(e1 != null && e1.l() == k)
                e1.b(l);
        } while(true);
        
    }

    public void b(cls_e parame)
    {
      Integer localInteger = new Integer(parame.m());
      synchronized (this.c)
      {
        this.c.remove(localInteger);
        return;
      }
    }

    public cls_f c()
    {
        return h;
    }

    public void c(int k)
    {
        Integer integer = new Integer(k);
        cls_e e1;
        synchronized(c)
        {
            e1 = (cls_e)c.remove(integer);
        }
        if(e1 != null)
            e1.e();
        return;
         
    }

    public void c(cls_e e1)
    {
        Integer integer;
        if(e1 == null)
            return;
        e1.a(this);
        if(e1 instanceof cls_a)
            ((cls_a)e1).a(h);
        integer = new Integer(e1.m());
        Hashtable hashtable = c;
        
        c.put(integer, e1);
    }

    public void d()
    {
        d.clear();
        Hashtable hashtable = c;
        
        Enumeration enumeration = c.elements();
        do
        {
            if(!enumeration.hasMoreElements())
                break;
            cls_e e1 = (cls_e)enumeration.nextElement();
            if(e1 != null)
                e1.e();
        } while(true);
        
    }

    private static int j = 0;
    Thread a;
    boolean b;
    Hashtable c;
    PriorityBlockingQueue d;
    ThreadPoolExecutor e;
    cls_e f;
    boolean g;
    cls_f h;
    int i;

}
